using UniversalAdminSystem.Domian.PermissionManagement.Aggregate;

namespace UniversalAdminSystem.Domian.PermissionManagement.Interfaces;

/// <summary>
/// 权限分配领域服务接口
/// 提供权限分配给角色的领域业务逻辑
/// </summary>
public interface IAssignPermissionDomainService
{
    /// <summary>
    /// 为角色分配权限
    /// </summary>
    /// <param name="permission">权限实体</param>
    /// <param name="role">角色实体</param>
    /// <returns>分配是否成功</returns>
    bool AssignPermission(Permission permission, Role role);

    /// <summary>
    /// 为角色移除权限
    /// </summary>
    /// <param name="permission">权限实体</param>
    /// <param name="role">角色实体</param>
    /// <returns>移除是否成功</returns>
    bool RemovePermission(Permission permission, Role role);

    /// <summary>
    /// 批量分配权限
    /// </summary>
    /// <param name="permissions">权限集合</param>
    /// <param name="role">角色实体</param>
    /// <returns>分配是否成功</returns>
    bool AssignPermissions(IEnumerable<Permission> permissions, Role role);

    /// <summary>
    /// 批量移除权限
    /// </summary>
    /// <param name="permissions">权限集合</param>
    /// <param name="role">角色实体</param>
    /// <returns>移除是否成功</returns>
    bool RemovePermissions(IEnumerable<Permission> permissions, Role role);
}